﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/include/context.jsp" %>
<form action="${ctx}/system/warning/save" method="post" style="margin: 0px;" id="form1">
			
	<input type="hidden" name="entityWarning.id" id="entityWarning.id" value="${entityWarning.id }">
	<table cellspacing="0" cellpadding="0" class="form-grid">
		<tbody>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">预警编码：</td>
				<td colspan="3"><input type="text" id = "entityWarning.code" name="entityWarning.code" size="35" value="${defaultWarnNumber == null ? entityWarning.code : defaultWarnNumber }" ${empty entityWarning && entityWarning == null ? ' dataType="Require" msg=""' : 'readonly="readonly"'  }></td>
			</tr>
			<tr>	
				<td style="text-align: right; padding-right: 3px; width: 20%;">预警名称：</td>
				<td  colspan="3"><input type="text" name="entityWarning.name" size="35" value="${entityWarning.name }" dataType="Require" msg="预警名称不能为空"/></td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">仓&nbsp;&nbsp;&nbsp;&nbsp;储：</td>
				<td colspan="3"> 
					<select name="entityWarning.warehouse.id"  dataType="Require" msg="未选定仓储">
						<option value=""  >请选择</option>
						<c:forEach var="warehouse" items="${chooseWarehouse}" varStatus="status">
							<c:if test="${!empty entityWarning.warehouse && warehouse.id==entityWarning.warehouse.id}">
								<option selected="selected" value="${warehouse.id}"  >${warehouse.code } - ${warehouse.name }</option>
							</c:if>
							
							<c:if test="${empty entityWarning.warehouse || entityWarning.warehouse.id !=warehouse.id}">
								<option value="${warehouse.id}"  >${warehouse.code } - ${warehouse.name }</option>
							</c:if>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">产&nbsp;&nbsp;&nbsp;&nbsp;品：</td>
				<td colspan="3">
					<select name="entityWarning.product.id" dataType="Require" msg="未选定产品">
						<option value="">请选择</option>
						<c:forEach var="product" items="${chooseProduct}" varStatus="status">
							<c:if test="${!empty entityWarning.product && product.id==entityWarning.product.id}">
								<option selected="selected" value="${product.id}"  >${product.productCode } - ${product.productName }</option>
							</c:if>
							
							<c:if test="${empty entityWarning.product || entityWarning.product.id !=product.id}">
								<option value="${product.id}"  >${product.productCode } - ${product.productName }</option>
							</c:if>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">操&nbsp;作&nbsp;符：</td>
				<td>
					<select name="entityWarning.warningEqualesType">
						<option value="EQ" ${entityWarning.warningEqualesType == 'EQ' ? 'selected=\'selected\''  : '' }>等于</option>
						<option value="GQ" ${entityWarning.warningEqualesType == 'GQ' ? 'selected=\'selected\''  : '' }>大于</option>
						<option value="GEQ" ${entityWarning.warningEqualesType == 'GEQ' ? 'selected=\'selected\'' : '' }>大于等于</option>
						<option value="LQ" ${entityWarning.warningEqualesType == 'LQ' ? 'selected=\'selected\'' : '' }>小于</option>
						<option value="LEQ" ${entityWarning.warningEqualesType == 'LEQ' ? 'selected=\'selected\''  : '' }>小于等于</option>
					</select> 
				</td>
				<td style="text-align: right; padding-right: 3px; width: 20%;">额定种类：</td>
				<td>
					<select name="entityWarning.warningType">
						<option value="percentage"  ${entityWarning.warningType == 'percentage' ? 'selected=\'selected\''  : '' }>额定数量</option>
						<option value="constants"  ${entityWarning.warningType == 'constants' ? 'selected=\'selected\''  : '' }>额定百分比</option>
						
					</select> 
				</td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">额定数量：</td>
				<td><input type="text" name="entityWarning.number" size="15" value="${entityWarning.number }"  dataType="Double" msg="必填-数字"/></td>
				<td style="text-align: right; padding-right: 3px; width: 20%;">额定百分比：</td>
				<td><input type="text" name="entityWarning.percentage" size="15" value="${entityWarning.percentage }"/></td>
			</tr>
			<tr>
				<td style="text-align: right; padding-right: 3px; width: 20%;">提&nbsp;&nbsp;&nbsp;&nbsp;示：</td>
				<td colspan="3"><input type="text" name="entityWarning.description" size="50" value="${entityWarning.description }"/></td>
			</tr>
		</tbody>
	</table>
			
	<div class="window_footer"><input type="button" value="确定" onclick="duplicateCheck($('form1'),3,'select count(1) from entity_warning where code =:code ','code','warehouse.code','预警编码重复，请重新输入','entityWarning.code' );"  }/></div>
</form>

<%@ include file="/include/script.jsp" %>